﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BusinessObjects.BO_GetObjects;
using System.Data;

public partial class Controls_Category : Base_Controls
{
    private int category_id;
    protected void Page_Load(object sender, EventArgs e)
    {
        base.PSize = 5;
        if (!IsPostBack)
        {
            this.Display();
        }
    }

    protected void Display()
    {

        category_id = Setting.getRequest(Request, "category_id", 72);
        DataTable DtCategory = BO_portal_categories.Search(category_id);
        if (DtCategory != null)
        {
            if(DtCategory.Rows.Count > 0)
            {
                if (base.Lang)
                {
                    lbTitle.Text = DtCategory.Rows[0]["FULL_CATEGORY_NAME_ENG"].ToString();
                }
                else
                {
                    lbTitle.Text = DtCategory.Rows[0]["FULL_CATEGORY_NAME"].ToString();
                }
                
            }
        }
        DataTable objDTs = BO_portal_articles.SelectByCategory(1, 8, category_id, "-----");
        if (base.Lang)
        {
            foreach (DataRow row in objDTs.Rows)
            {
                row["FULL_ARTICLE_TITLE"] = row["FULL_ARTICLE_TITLE_ENG"].ToString();
            }
            bindRepeater(rptProduct, objDTs, pagerContainer);
        }
        else
        {
            bindRepeater(rptProduct, objDTs, pagerContainer);
        }

    }
}